import request from '@/utils/request'

// 查询抽奖活动列表
export function listRaffle(query) {
  return request({
    url: '/ypp/raffle/list',
    method: 'get',
    params: query
  })
}

// 查询抽奖活动详细
export function getRaffle(id) {
  return request({
    url: '/ypp/raffle/' + id,
    method: 'get'
  })
}

// 新增抽奖活动
export function addRaffle(data) {
  return request({
    url: '/ypp/raffle',
    method: 'post',
    data: data
  })
}

// 修改抽奖活动
export function updateRaffle(data) {
  return request({
    url: '/ypp/raffle',
    method: 'put',
    data: data
  })
}

// 删除抽奖活动
export function delRaffle(id) {
  return request({
    url: '/ypp/raffle/' + id,
    method: 'delete'
  })
}

// 导出抽奖活动
export function exportRaffle(query) {
  return request({
    url: '/ypp/raffle/export',
    method: 'get',
    params: query
  })
}